package org.shangda.wechat.pet.enums;

/**
 * 性别枚举类
 */
public enum GenderEnum {
    // 女士
    FEMALE(2,"Female"),
    // 男士
    MALE(1, "Male");

    private Integer value;
    private String text;

    GenderEnum(Integer value, String text){
        this.value = value;
        this.text = text;
    }

    public Integer getValue() {
        return value;
    }

    public String getText() {
        return text;
    }


    public static GenderEnum getGenderEnumByText(String text){
        if(null == text || text.trim().length() == 0){
            return null;
        }
        for(GenderEnum enumObj : GenderEnum.values()){
            if(enumObj.getText().equals(text)){
                return enumObj;
            }
        }
        return null;
    }
}
